import 'dart:convert';
/// id : "bd100f5e-e169-4567-8e3e-f3bc212404cb"
/// name : "调研.jpg"
/// duration : "0"
/// sourcePath : "https://njkzy.szzfyjzx.icu/group1/default/20220811/16/18/0/d73bda5d-4155-421f-a028-0937cf049655.jpg?download=0"
/// thumbnailPath : "https://njkzy.szzfyjzx.icu/group1/default/20220811/16/18/0/0c904afc-7713-4cdd-a962-69de4e7aa95d.jpg?download=0"
/// fileType : "jpg"

FileEntity fileEntityFromJson(String str) => FileEntity.fromJson(json.decode(str));
String fileEntityToJson(FileEntity data) => json.encode(data.toJson());
class FileEntity {
  FileEntity({
      String? id, 
      String? name, 
      String? duration, 
      String? sourcePath, 
      String? thumbnailPath, 
      String? fileType,}){
    _id = id;
    _name = name;
    _duration = duration;
    _sourcePath = sourcePath;
    _thumbnailPath = thumbnailPath;
    _fileType = fileType;
}

  FileEntity.fromJson(dynamic json) {
    _id = json['id'];
    _name = json['name'];
    _duration = json['duration'];
    _sourcePath = json['sourcePath'];
    _thumbnailPath = json['thumbnailPath'];
    _fileType = json['fileType'];
  }
  String? _id;
  String? _name;
  String? _duration;
  String? _sourcePath;
  String? _thumbnailPath;
  String? _fileType;
FileEntity copyWith({  String? id,
  String? name,
  String? duration,
  String? sourcePath,
  String? thumbnailPath,
  String? fileType,
}) => FileEntity(  id: id ?? _id,
  name: name ?? _name,
  duration: duration ?? _duration,
  sourcePath: sourcePath ?? _sourcePath,
  thumbnailPath: thumbnailPath ?? _thumbnailPath,
  fileType: fileType ?? _fileType,
);
  String? get id => _id;
  String? get name => _name;
  String? get duration => _duration;
  String? get sourcePath => _sourcePath;
  String? get thumbnailPath => _thumbnailPath;
  String? get fileType => _fileType;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['name'] = _name;
    map['duration'] = _duration;
    map['sourcePath'] = _sourcePath;
    map['thumbnailPath'] = _thumbnailPath;
    map['fileType'] = _fileType;
    return map;
  }

}